<?php

/**
 * Description of Util
 *
 * @author jay
 */
class Util {

    public static function getLeftNavList($activeItem) {
        echo '<ul class="nav nav-list">';
        echo '<li class="nav-header">Shortcuts</li>';
        echo '<li ';
        if ($activeItem == "Home")
            echo 'class="active"';
        echo '><a href="home.php"><i class="icon-home"></i> Home</a></li>';
        echo '<li ';
        if ($activeItem == "Projects")
            echo 'class="active"';
        echo '><a href="projects.php"><i class="icon-file"></i> Projects</a></li>';
        echo '<li ';
        if ($activeItem == "People")
            echo 'class="active"';
        echo '><a href="people.php"><i class="icon-user"></i> People</a></li>';
		echo '<li ';
        if ($activeItem == "About")
            echo 'class="active"';
        echo '><a href="about.php"><i class="icon-info-sign"></i> About</a></li>';
        echo '</ul>';
    }

    public static function getTopRightDropDown() {
        echo '<div class="btn-group pull-right">';
        echo '<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">';
        echo '<i class="icon-user"></i> ' . $_SESSION['username'];
        echo ' <span class="caret"></span>';
        echo '</a>';
        echo '<ul class="dropdown-menu">';
        echo '<li><a href="profile.php">Profile</a></li>';
        echo '<li class="divider"></li>';
        echo '<li><a href="logout.php">Logout</a></li>';
        echo '</ul>';
        echo '</div>';
    }

    public static function getNavBar() {
        echo '<div class="navbar navbar-inverse navbar-fixed-top">';
        echo '<div class="navbar-inner">';
        echo '<div class="container-fluid">';
        echo '<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">';
        echo '<span class="icon-bar"></span>';
        echo '<span class="icon-bar"></span>';
        echo '<span class="icon-bar"></span>';
        echo '</a>';
        echo '<a class="brand" href="home.php">iTrack</a>';
        echo Util::getTopRightDropDown();
        echo '<div class="nav-collapse">';
        echo '<ul class="nav">';
        echo '<li class="active"><a href="home.php"><i class="icon-home icon-white"></i> Home</a></li>';
        echo '<li class="dropdown">';
        echo '<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-tasks icon-white"></i> Options <b class="caret"></b></a>';
        echo '<ul class="dropdown-menu">';
        echo '<li><a href="settings.php"><i class="icon-wrench"></i> Settings</a></li>';
        echo '<li><a href="feedback.php"><i class="icon-thumbs-up"></i> Send Feedback</a></li>';
        echo '<li><a href="about.php"><i class="icon-info-sign"></i>About</a></li>';
        echo '</ul>';
        echo '</li>';
        echo '</ul>';
        echo '</div><!--/.nav-collapse -->';
        echo '</div>';
        echo '</div>';
        echo '</div>';
    }

    public static function getTaskTypeSelBox($id, $name, $selected) {
        if($selected == '') {
            $selected = 'Bug';
        }
        
        echo '<select id = "' . $id . '" name = "' . $name . '">';
        echo '<option ';
        if ($selected == 'Bug')
            echo ' selected ';
        echo ' >Bug</option>';

        echo '<option ';
        if ($selected == 'Enhancement')
            echo ' selected ';
        echo ' >Enhancement</option>';

        echo '<option ';
        if ($selected == 'Meeting')
            echo ' selected ';
        echo ' >Meeting</option>';

        echo '<option ';
        if ($selected == 'Other')
            echo ' selected ';
        echo ' >Other</option>';

        echo '</select>';
    }
    
    public static function getTaskStatusSelBox($id, $name, $selected) {
        if($selected == '') {
            $selected = 'Assigned';
        }
        
        echo '<select id = "' . $id . '" name = "' . $name . '">';
        echo '<option ';
        if ($selected == 'Assigned')
            echo ' selected ';
        echo ' >Assigned</option>';

        echo '<option ';
        if ($selected == 'In-progress')
            echo ' selected ';
        echo ' >In-progress</option>';

        echo '<option ';
        if ($selected == 'Inactive')
            echo ' selected ';
        echo ' >Inactive</option>';

        echo '<option ';
        if ($selected == 'Done')
            echo ' selected ';
        echo ' >Done</option>';

        echo '</select>';
    }

}
?>
